package Test.Control;

import android.R.drawable;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.Gravity;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;

public class UpDownEdit extends LinearLayout {
	private Context mContext; 
	private String Text = "";
	ImageButton upImageButton,downImageButton;
	EditText upDown_EditText;
	public UpDownEdit(Context context, AttributeSet attrs)  {
    	super(context, attrs);
    	 mContext = context;
    	 downImageButton = new ImageButton(context,attrs);
    	 downImageButton.setBackgroundResource(R.drawable.updown_edit_shape_down);
    	 upImageButton = new ImageButton(context,attrs);
    	 upImageButton.setBackgroundResource(R.drawable.updown_edit_shape_up);
    	 upDown_EditText = new EditText(context, attrs);

    	 upDown_EditText.setGravity(Gravity.CENTER_VERTICAL|Gravity.CENTER_HORIZONTAL);
    	 Resources rs = getResources();
    	 Drawable background = rs.getDrawable(R.drawable.updown_edit_text);
    	 
    	 upDown_EditText.setBackgroundDrawable(background);
    	 upDown_EditText.requestLayout();
    	 LayoutParams LP_FF = new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.FILL_PARENT);
    	 downImageButton.setLayoutParams(LP_FF);
    	 upImageButton.setLayoutParams(LP_FF);
    	 
    //	 upDown_EditText.setLayoutParams(LP_FF);
    	 upDown_EditText.setText("12");
    	 
    	// addView(downImageButton, new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,50));
    	 addView(downImageButton);
    	 addView(upDown_EditText);
    	 addView(upImageButton);
	}
	
	private void CreateButtons() {
	
		
		/*LayoutParams params = (LayoutParams)downImageButton.getLayoutParams();
		params.setMargins(0, 0, 10, 0); 
		downImageButton.setLayoutParams(params);*/
		
		//upImageButton = new ImageButton(mContext);
		//upImageButton.setBackgroundResource(R.drawable.shape_up);
		
				
	}
}
